home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / spwno413.zip / TEST.PAS < prev   
Pascal/Delphi Source File  |  1991-11-14  |  1KB  |  33 lines

  1. {============================================================================}
  2. { (c) Copyright 1991 Ralf Brown    All Rights Reserved                 }
  3. { This file is part of the SPAWNO package and may be redistributed as a part }
  4. { of, and under the same terms as, that package.                 }
  5. {============================================================================}
  6.  
  7. Program SPAWNO_TEST (output) ;
  8.  
  9. {$M 4096,0,200000 }
  10. (* can't set max heap to 655360, because SPAWNO needs 384 bytes available from
  11.    DOS for a stack *)
  12.  
  13. uses spawno ;
  14.  
  15. var
  16.    retval : integer ;
  17.    comspec : string ;
  18.  
  19. begin
  20.    writeln('SPAWNO test') ;
  21.    init_spawno('.',swap_all,20,0) ;
  22.       (* note: init_spawno does not attempt to use environment variables to
  23.      determine the directories to use for swapping; you must do that
  24.      manually if you do not wish to hardcode the paths *)
  25.    comspec := 'c:\command.com' ;
  26.    retval := spawn(comspec,'',0) ;
  27.    writeln('Done with ',comspec) ;
  28.    if (retval = -1)
  29.       then writeln('Error code = ',spawno_error)
  30.       else writeln('Return code = ',retval) ;
  31. end.
  32.  
  33.